package com.icw.configuration.poentity;

import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.icw.configuration.data_interchange.RpcResult;
import com.icw.configuration.poentity.vo.PropertiesData;
import com.icw.utility.IcwUtils;
import com.icw.utility.PoEntityHelper;

@RestController
@RequestMapping("/statics")
public class PoEntityMappingConfig {

	@GetMapping("/poEntities")
	public void get(HttpServletResponse resp) throws Exception {
		IcwUtils.makeCorsHeader(resp);
		PropertiesData mapping = PoEntityHelper.getPropertiesData();
		RpcResult result = new RpcResult(true, null, IcwUtils.mapObject("data", mapping));
		IcwUtils.render(resp, result);
	}
}
